load("@rules_rust//rust:defs.bzl", "rust_binary")
load("@rules_shell//shell:sh_test.bzl", "sh_test")
load("//publish:defs.bzl", "release_nostrip_binary")

rust_binary(
    name = "debug_assertions_on",
    srcs = ["src/main.rs"],
)

release_nostrip_binary(
    name = "debug_assertions_off",
    binary = ":debug_assertions_on",
)

sh_test(
    name = "debug_assertion_test",
    srcs = ["debug_assertion_test.sh"],
    data = [
        ":debug_assertions_off",
        ":debug_assertions_on",
    ],
    env = {
        "DEBUG_ASSERTIONS_OFF_BIN": "$(rootpath :debug_assertions_off)",
        "DEBUG_ASSERTIONS_ON_BIN": "$(rootpath :debug_assertions_on)",
    },
)
